﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using EmbeddedSensorCloud.Core.Plugin;
using System.IO;
using EmbeddedSensorCloud.Console.Commands;
using System.Collections.Generic;
using EmbeddedSensorCloud.Log;
using EmbeddedSensorCloud.Core.Server;

namespace EmbeddedSensorCloud.UnitTest
{
    [TestClass]
    public class CommandBase_Test
    {
        [TestMethod]
        [ExpectedException(typeof(ArgumentException))]
        public void CommandBase_Execute_Null_Test()
        {
            NilCommand com = new NilCommand();
            com.Execute(null);
        }

        [TestMethod]
        public void CommandBase_CanExecute_Null_Test()
        {
            NilCommand com = new NilCommand();
            Assert.IsFalse(com.CanExecute(null));
        }

        [TestMethod]
        public void CommandBase_ToString_Nil_Test()
        {
            NilCommand com = new NilCommand();
            Assert.IsNotNull(com.ToString());
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void CommandBase_Execute_Nil_Test()
        {
            NilCommand com = new NilCommand();
            com.Execute("nil");
        }
    }
}
